<?php
namespace GRH\Controller;

use GRH\Model\CodeActivite;
use GRH\Form\CodeActiviteForm;

class ActiviteController extends BaseController
{
    /**
     * Lister tous les codes d'activités
     */
    public function indexAction()
    {
        $codeList = $this->getService('GRH\Model\Table\CodeActiviteTable')
                ->getAll();
        $newCode = new CodeActiviteForm();
        $couleurs = $this->getService('GRH\Model\Table\CouleurTable')
                ->getSelectList();
        $newCode->get('couleur')->setValueOptions($couleurs);
        
        return array(
            'codeList' => $codeList,
            'newCode' => $newCode,
        );
    }
}